home *** CD-ROM | disk | FTP | other *** search
/ PC Media 20 / PC MEDIA CD20.iso / share / os2 / fm2_235 / install.cmd < prev    next >
Encoding:
Text File  |  1995-07-15  |  27.4 KB  |  789 lines

  1. /*
  2.  * FM/2 2.x installation program copyright (c) 1994/95 by M. Kimes
  3.  *
  4.  * This program creates a folder to hold program objects,
  5.  * then creates program objects for each executable.  It only needs to be
  6.  * run once (unless you move the FM/2 directory -- see say notes at end).
  7.  * It also calls MIGINI.CMD if it finds an old FM2.INI file to migrate
  8.  * some information to the new version's FM3.INI file.  Run this program
  9.  * in the FM/2 directory (where you unpacked the archive).
  10.  *
  11.  * For unattended installation, remove the lines marked with "NOTE:" below.
  12.  */
  13.  
  14. /* see if we might be in the right directory... */
  15.  
  16. '@Echo off'
  17. 'cls'
  18.  
  19. say'     ┌───────────────────────────────────────────────────────────────────┐'
  20. say'     │                  FM/2 2.x Installation Program                    │'
  21. say'     │             FM/2 is copyright (c) 1993-95 by M. Kimes             │'
  22. say'     │                       All rights reserved                         │'
  23. say'     ├───────────────────────────────────────────────────────────────────┤'
  24. say'     ├───────────────────────────────────────────────────────────────────┤'
  25. say'     │                Have you read the READ.ME file yet?                │'
  26. say'     │        By running this program, you agree to the license          │'
  27. say'     │                     as specified in that file,                    │'
  28. say'     │      and it tells you how to install, so you should read it.      │'
  29. say'     │                             Please?                               │'
  30. say'     └───────────────────────────────────────────────────────────────────┘'
  31.  
  32. /*
  33.  * allow user to eliminate associations from being placed on AV/2.
  34.  * seemed to upset some fellow on CIS (I guess he doesn't know about
  35.  * Settings notebooks on WPS objects).
  36.  */
  37. assocfilter = ';ASSOCFILTER=*.ZIP,*.ARC,*.LZH,*.ARJ,*.ZOO,*.MO0,READ.ME,README,README.1ST,README.OS2,REGISTER.TXT'
  38. existed = ''
  39. parse upper arg dummy
  40. if dummy = 'NOASSOC' then assocfilter = ''
  41.  
  42. rc = stream('fm3.exe','c','query exists')
  43. if rc = '' then
  44. do
  45.   say 'Sorry, FM3.EXE not found.  Must not be right directory.  Terminating.'
  46.   exit
  47. end
  48.  
  49. /* tell user what we're doing, give him a chance to hit CTRL-C */
  50.  
  51. say ''
  52. say 'This program creates objects for FM/2 and does some drudgework for you.'
  53. say ''
  54.  
  55. /* load rexx utility functions */
  56.  
  57. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  58. call SysLoadFuncs
  59.  
  60. /* NOTE:  remove following 6 lines for unattended use... */
  61. call charout ,'  Press [Enter] to continue...'
  62. dummy = ''
  63. do until dummy = '0d'x
  64.   dummy = SysGetKey('NOECHO')
  65. end
  66. call charout ,'0d1b'x'[K'
  67.  
  68. /* save current directory */
  69.  
  70. curdir = directory()
  71.  
  72. /* say it, then do it */
  73.  
  74. say "Creating File Manager/2 folder and objects..."
  75.  
  76. /* first, create FM/2 folder */
  77.  
  78. title = "File Manager/2"
  79. classname = 'WPFolder'
  80. location = '<WP_DESKTOP>'
  81. setup = 'OBJECTID=<FM3_Folder>;OPEN=DEFAULT'
  82. result=SysCreateObject(classname,title,location,setup,f)
  83.  
  84. /* NOTE:  remove following 18 lines for unattended use... */
  85. if result = 0 then
  86. do
  87.   assocfilter = ''
  88.   existed = 'TRUE'
  89.   say ''
  90.   say 'The File Manager/2 folder already exists.'
  91.   call charout ,"Should I update the objects (it's painless)? (Y/n) "
  92.   dummy = ''
  93.   do forever
  94.     dummy = SysGetKey('NOECHO')
  95.     parse upper var dummy dummy
  96.     if dummy = '1b'x then dummy = 'N'
  97.     if dummy = '0d'x then dummy = 'Y'
  98.     if dummy = 'N' then leave
  99.     if dummy = 'Y' then leave
  100.   end
  101.   call charout ,dummy
  102.   say ''
  103.   if dummy = 'N' then exit
  104. end
  105.  
  106. /* now, create program objects in FM/2 folder */
  107.  
  108. title = "FM/2"
  109. classname = 'WPProgram'
  110. location = '<FM3_Folder>'
  111. setup = 'OBJECTID=<FM/2>;EXENAME='curdir'\FM3.EXE;STARTUPDIR='curdir
  112. if existed = '' then setup = setup';PARAMETERS=%*'
  113. call SysCreateObject classname,title,location,setup,u
  114.  
  115. rc = stream('av2.exe','c','query exists')
  116. if rc \= '' then
  117. do
  118.   title = "Archive Viewer/2"
  119.   classname = 'WPProgram'
  120.   location = '<FM3_Folder>'
  121.   setup = 'EXENAME='curdir'\AV2.EXE;STARTUPDIR='curdir''assocfilter
  122.   if existed = '' then setup = setup';PARAMETERS=%*'
  123.   call SysCreateObject classname,title,location,setup,u
  124. end
  125.  
  126. rc = stream('doicon.exe','c','query exists')
  127. if rc \= '' then
  128. do
  129.   title = "SysIcon"
  130.   classname = 'WPProgram'
  131.   location = '<FM3_Folder>'
  132.   setup = 'EXENAME='curdir'\DOICON.EXE;STARTUPDIR='curdir
  133.   if existed = '' then setup = setup';PARAMETERS=%*'
  134.   call SysCreateObject classname,title,location,setup,u
  135. end
  136.  
  137. rc = stream('eas.exe','c','query exists')
  138. if rc \= '' then
  139. do
  140.   title = "EA Viewer"
  141.   classname = 'WPProgram'
  142.   location = '<FM3_Folder>'
  143.   setup = 'EXENAME='curdir'\EAS.EXE;STARTUPDIR='curdir
  144.   if existed = '' then setup = setup';PARAMETERS=%*'
  145.   call SysCreateObject classname,title,location,setup,u
  146. end
  147.  
  148. rc = stream('ini.exe','c','query exists')
  149. if rc \= '' then
  150. do
  151.   if assocfilter \= '' then assocfilter = ';ASSOCFILTER=*.INI'
  152.   title = "INI Viewer"
  153.   classname = 'WPProgram'
  154.   location = '<FM3_Folder>'
  155.   setup = 'EXENAME='curdir'\INI.EXE;STARTUPDIR='curdir''assocfilter
  156.   if existed = '' then setup = setup';PARAMETERS=%*'
  157.   call SysCreateObject classname,title,location,setup,u
  158. end
  159.  
  160. rc = stream('viewinfs.exe','c','query exists')
  161. if rc \= '' then
  162. do
  163.   title = "Bookshelf Viewer"
  164.   classname = 'WPProgram'
  165.   location = '<FM3_Folder>'
  166.   setup = 'EXENAME='curdir'\VIEWINFS.EXE;STARTUPDIR='curdir
  167.   call SysCreateObject classname,title,location,setup,u
  168.   title = "Helpfile Viewer"
  169.   classname = 'WPProgram'
  170.   location = '<FM3_Folder>'
  171.   setup = 'EXENAME='curdir'\VIEWINFS.EXE;PARAMETERS=DUMMY;STARTUPDIR='curdir
  172.   call SysCreateObject classname,title,location,setup,u
  173. end
  174.  
  175. rc = stream('killproc.exe','c','query exists')
  176. if rc \= '' then
  177. do
  178.   title = "Process Killer"
  179.   classname = 'WPProgram'
  180.   location = '<FM3_Folder>'
  181.   setup = 'OBJECTID=<FM/2_KILLPROC>;EXENAME='curdir'\KILLPROC.EXE;PARAMETERS=%;STARTUPDIR='curdir
  182.   call SysCreateObject classname,title,location,setup,u
  183. end
  184.  
  185. rc = stream('undel.exe','c','query exists')
  186. if rc \= '' then
  187. do
  188.   title = "Undeleter"
  189.   classname = 'WPProgram'
  190.   location = '<FM3_Folder>'
  191.   setup = 'OBJECTID=<FM/2_UNDEL>;EXENAME='curdir'\UNDEL.EXE;STARTUPDIR='curdir
  192.   if existed = '' then setup = setup';PARAMETERS=%*'
  193.   call SysCreateObject classname,title,location,setup,u
  194. end
  195.  
  196. rc = stream('vtree.exe','c','query exists')
  197. if rc \= '' then
  198. do
  199.   title = "Visual Tree"
  200.   classname = 'WPProgram'
  201.   location = '<FM3_Folder>'
  202.   setup = 'OBJECTID=<FM/2_VTREE>;EXENAME='curdir'\VTREE.EXE;STARTUPDIR='curdir
  203.   call SysCreateObject classname,title,location,setup,u
  204. end
  205.  
  206. rc = stream('vdir.exe','c','query exists')
  207. if rc \= '' then
  208. do
  209.   title = "Visual Directory"
  210.   classname = 'WPProgram'
  211.   location = '<FM3_Folder>'
  212.   setup = 'OBJECTID=<FM/2_VDIR>;EXENAME='curdir'\VDIR.EXE;STARTUPDIR='curdir
  213.   if existed = '' then setup = setup';PARAMETERS=%*'
  214.   call SysCreateObject classname,title,location,setup,u
  215. end
  216.  
  217. rc = stream('vcollect.exe','c','query exists')
  218. if rc \= '' then
  219. do
  220.   title = "Collector"
  221.   classname = 'WPProgram'
  222.   location = '<FM3_Folder>'
  223.   setup = 'OBJECTID=<FM/2_VCOLLECT>;EXENAME='curdir'\VCOLLECT.EXE;STARTUPDIR='curdir
  224.   call SysCreateObject classname,title,location,setup,u
  225.   title = "Seek and scan"
  226.   classname = 'WPProgram'
  227.   location = '<FM3_Folder>'
  228.   setup = 'OBJECTID=<FM/2_VSEEK>;EXENAME='curdir'\VCOLLECT.EXE;PARAMETERS=**;STARTUPDIR='curdir
  229.   call SysCreateObject classname,title,location,setup,u
  230. end
  231.  
  232. rc = stream('global.exe','c','query exists')
  233. if rc \= '' then
  234. do
  235.   title = "Global File Viewer"
  236.   classname = 'WPProgram'
  237.   location = '<FM3_Folder>'
  238.   setup = 'OBJECTID=<FM/2_SEEALL>;EXENAME='curdir'\GLOBAL.EXE;STARTUPDIR='curdir
  239.   call SysCreateObject classname,title,location,setup,u
  240. end
  241.  
  242. rc = stream('databar.exe','c','query exists')
  243. if rc \= '' then
  244. do
  245.   title = "Databar"
  246.   classname = 'WPProgram'
  247.   location = '<FM3_Folder>'
  248.   setup = 'OBJECTID=<FM/2_DATABAR>;EXENAME='curdir'\DATABAR.EXE;STARTUPDIR='curdir
  249.   call SysCreateObject classname,title,location,setup,u
  250. end
  251.  
  252. rc = stream('READ.ME','c','query exists')
  253. if rc \= '' then
  254. do
  255.   title = "Read.Me"
  256.   classname = 'WPShadow'
  257.   location = '<FM3_Folder>'
  258.   setup = 'SHADOWID='rc
  259.   call SysCreateObject classname,title,location,setup,u
  260. end
  261.  
  262. rc = stream('HISTORY.TXT','c','query exists')
  263. if rc \= '' then
  264. do
  265.   title = "History.Txt"
  266.   classname = 'WPShadow'
  267.   location = '<FM3_Folder>'
  268.   setup = 'SHADOWID='rc
  269.   call SysCreateObject classname,title,location,setup,u
  270. end
  271.  
  272. rc = stream('REGISTER.TXT','c','query exists')
  273. if rc \= '' then
  274. do
  275.   title = "Register.Txt"
  276.   classname = 'WPShadow'
  277.   location = '<FM3_Folder>'
  278.   setup = 'SHADOWID='rc
  279.   call SysCreateObject classname,title,location,setup,u
  280. end
  281.  
  282. rc = stream('ASSOCIAT.TXT','c','query exists')
  283. if rc \= '' then
  284. do
  285.   title = "Associat.Txt"
  286.   classname = 'WPShadow'
  287.   location = '<FM3_Folder>'
  288.   setup = 'SHADOWID='rc
  289.   call SysCreateObject classname,title,location,setup,u
  290. end
  291.  
  292. rc = stream('FM3.HLP','c','query exists')
  293. if rc \= '' then
  294. do
  295.   if assocfilter \= '' then assocfilter=';ASSOCFILTER=*.HLP'
  296.   rc = stream('SEEHELP.EXE','c','query exists')
  297.   if rc \= '' then
  298.   do
  299.     title = "FM/2 Online Help"
  300.     classname = 'WPProgram'
  301.     location = '<FM3_Folder>'
  302.     setup = 'EXENAME='curdir'\SEEHELP.EXE;STARTUPDIR='curdir';PARAMETERS= %* 'curdir'\FM3.HLP'
  303.     call SysCreateObject classname,title,location,setup,u
  304.   end
  305. end
  306.  
  307. rc = stream('UTILS\FATOPT.EXE','c','query exists')
  308. if rc \= '' then
  309. do
  310.   title = "FAT Optimizer"
  311.   classname = 'WPProgram'
  312.   location = '<FM3_Folder>'
  313.   setup = 'EXENAME='rc';STARTUPDIR='curdir'\UTILS;PARAMETERS=[Drive letter] [-Options]'
  314.   call SysCreateObject classname,title,location,setup,u
  315. end
  316.  
  317. rc = stream('UTILS\HPFSOPT.EXE','c','query exists')
  318. if rc \= '' then
  319. do
  320.   title = "HPFS Optimizer"
  321.   classname = 'WPProgram'
  322.   location = '<FM3_Folder>'
  323.   setup = 'EXENAME='rc';STARTUPDIR='curdir'\UTILS;PARAMETERS=[Drive:\Path] [-Options]'
  324.   call SysCreateObject classname,title,location,setup,u
  325. end
  326.  
  327. rc = stream('UTILS\MAKEOBJ.CMD','c','query exists')
  328. if rc \= '' then
  329. do
  330.   title = "Make Object"
  331.   classname = 'WPProgram'
  332.   location = '<FM3_Folder>'
  333.   setup = 'EXENAME='rc';STARTUPDIR='curdir'\UTILS;PARAMETERS=%*'
  334.   call SysCreateObject classname,title,location,setup,u
  335. end
  336.  
  337. /* create sample customizations for the user so they don't start 'blank' */
  338.  
  339. rc = stream('FM3MENU.DAT','c','query exists')
  340. if rc = '' then
  341. do
  342.   rc = stream('FM2MENU.TMP','c','query exists')
  343.   if rc \= '' then
  344.   do
  345.     say 'Creating a sample FM3MENU.DAT file for you.'
  346.     'REN FM3MENU.TMP FM3MENU.DAT 1>NUL 2>NUL'
  347.   end
  348. end
  349. 'DEL FM3MENU.TMP 1>NUL 2>NUL'
  350. rc = stream('ASSOC.DAT','c','query exists')
  351. if rc = '' then
  352. do
  353.   rc = stream('ASSOC.TMP','c','query exists')
  354.   if rc \= '' then
  355.   do
  356.     say 'Creating a sample ASSOC.DAT file for you.'
  357.     'REN ASSOC.TMP ASSOC.DAT 1>NUL 2>NUL'
  358.   end
  359. end
  360. 'DEL ASSOC.TMP 1>NUL 2>NUL'
  361. rc = stream('COMMANDS.DAT','c','query exists')
  362. if rc = '' then
  363. do
  364.   rc = stream('COMMANDS.TMP','c','query exists')
  365.   if rc \= '' then
  366.   do
  367.     say 'Creating a sample COMMANDS.DAT file for you.'
  368.     'REN COMMANDS.TMP COMMANDS.DAT 1>NUL 2>NUL'
  369.   end
  370. end
  371. 'DEL COMMANDS.TMP 1>NUL 2>NUL'
  372. rc = stream('FILTERS.DAT','c','query exists')
  373. if rc = '' then
  374. do
  375.   rc = stream('FILTERS.TMP','c','query exists')
  376.   if rc \= '' then
  377.   do
  378.     say 'Creating a sample FILTERS.DAT file for you.'
  379.     'REN FILTERS.TMP FILTERS.DAT 1>NUL 2>NUL'
  380.   end
  381. end
  382. 'DEL FILTERS.TMP 1>NUL 2>NUL'
  383. rc = stream('FM3TOOLS.DAT','c','query exists')
  384. if rc = '' then
  385. do
  386.   rc = stream('FM3TOOLS.TMP','c','query exists')
  387.   if rc \= '' then
  388.   do
  389.     say 'Creating a sample FM3TOOLS.DAT file for you.'
  390.     'REN FM3TOOLS.TMP FM3TOOLS.DAT 1>NUL 2>NUL'
  391.   end
  392. end
  393. 'DEL FM3TOOLS.TMP 1>NUL 2>NUL'
  394. rc = stream('QUICKTLS.DAT','c','query exists')
  395. if rc = '' then
  396. do
  397.   rc = stream('QUICKTLS.TMP','c','query exists')
  398.   if rc \= '' then
  399.   do
  400.     rc = stream('CMDS.TMP','c','query exists')
  401.     if rc \= '' then
  402.     do
  403.       rc = stream('UTILS.TMP','c','query exists')
  404.       if rc \= '' then
  405.       do
  406.         rc = stream('SORT.TMP','c','query exists')
  407.         if rc \= '' then
  408.         do
  409.           rc = stream('SELECT.TMP','c','query exists')
  410.           if rc \= '' then
  411.           do
  412.             say 'Creating a sample QUICKTLS.DAT file and toolboxes for you.'
  413.             'REN QUICKTLS.TMP QUICKTLS.DAT 1>NUL 2>NUL'
  414.             'REN CMDS.TMP CMDS.TLS 1>NUL 2>NUL'
  415.             'REN UTILS.TMP UTILS.TLS 1>NUL 2>NUL'
  416.             'REN SORT.TMP SORT.TLS 1>NUL 2>NUL'
  417.             'REN SELECT.TMP SELECT.TLS 1>NUL 2>NUL'
  418.           end
  419.           'DEL SELECT.TMP 1>NUL 2>NUL'
  420.         end
  421.        'DEL SORT.TMP 1>NUL 2>NUL'
  422.       end
  423.       'DEL UTILS.TMP 1>NUL 2>NUL'
  424.     end
  425.     'DEL CMDS.TMP 1>NUL 2>NUL'
  426.   end
  427. end
  428. 'DEL QUICKTLS.TMP 1>NUL 2>NUL'
  429.  
  430. /*
  431.  * create command files that the user can execute from anywhere (we'll
  432.  * ask the user to put this utils directory on the PATH) and that other
  433.  * programs can execute to use FM/2 as "their" file manager.
  434.  */
  435.  
  436. 'del SETENV.CMD 1>NUL 2>NUL'
  437. dummy = stream('SETENV.CMD','C','open')
  438. if dummy = 'READY:' then
  439. do
  440.   call lineout 'SETENV.CMD','@ECHO OFF'
  441.   call lineout 'SETENV.CMD','REM'
  442.   call lineout 'SETENV.CMD','REM If you prefer, you can call this .CMD file'
  443.   call lineout 'SETENV.CMD','REM instead of altering the PATH= statement in'
  444.   call lineout 'SETENV.CMD','REM CONFIG.SYS to gain access to the FM/2'
  445.   call lineout 'SETENV.CMD','REM command line utilities.'
  446.   call lineout 'SETENV.CMD','REM'
  447.   call lineout 'SETENV.CMD','IF "%FM2ENVSET%" == "" GOTO INSTALL'
  448.   call lineout 'SETENV.CMD','GOTO SKIP'
  449.   call lineout 'SETENV.CMD',':INSTALL'
  450.   call lineout 'SETENV.CMD','SET FM2ENVSET=YES'
  451.   call lineout 'SETENV.CMD','SET PATH=%PATH%;'curdir'\utils;'
  452.   call lineout 'SETENV.CMD','ECHO Path set for FM/2 and utilities.'
  453.   call lineout 'SETENV.CMD','GOTO END'
  454.   call lineout 'SETENV.CMD',':SKIP'
  455.   call lineout 'SETENV.CMD','ECHO Paths already set for FM/2 and utilities.'
  456.   call lineout 'SETENV.CMD',':END'
  457.   call stream 'SETENV.CMD','C','close'
  458. end
  459.  
  460. /*
  461.  * place an object for SETENV.CMD in folder so user doesn't have to diddle
  462.  * their PATH statement if they don't want to for command line work.
  463.  */
  464.  
  465.  
  466. rc = stream('SETENV.CMD','c','query exists')
  467. if rc \= '' then
  468. do
  469.   title = "Utility command line"
  470.   classname = 'WPProgram'
  471.   location = '<FM3_Folder>'
  472.   setup = 'EXENAME=cmd.exe;PARAMETERS=/K 'rc';STARTUPDIR=C:\'
  473.   call SysCreateObject classname,title,location,setup,u
  474.   setup = 'EXENAME=*;PARAMETERS=/K 'rc';STARTUPDIR=C:\'
  475.   call SysCreateObject classname,title,location,setup,u
  476. end
  477.  
  478. call SysMkDir curdir'\UTILS'
  479. dummy = directory(curdir'\UTILS')
  480. if dummy = curdir'\UTILS' then
  481. do
  482.   'set PATH=%PATH%;'curdir'\utils'
  483.   'move ..\example.cmd 1>NUL 2>NUL'
  484.   'del FM2.CMD 1>NUL 2>NUL'
  485.   dummy = stream('FM2.CMD','C','open')
  486.   if dummy = 'READY:' then
  487.   do
  488.     say 'Creating an FM2.CMD file.'
  489.     call lineout 'FM2.CMD', "/* FM/2 command file.  Locate in a directory"
  490.     call lineout 'FM2.CMD', " * on your PATH. */"
  491.     call lineout 'FM2.CMD', "'@echo off'"
  492.     call lineout 'FM2.CMD', "arg dummy"
  493.     call lineout 'FM2.CMD', "if dummy = '' then"
  494.     call lineout 'FM2.CMD', "  curdir = directory()"
  495.     call lineout 'FM2.CMD', "else"
  496.     call lineout 'FM2.CMD', "  curdir = ''"
  497.     call lineout 'FM2.CMD', "n = setlocal()"
  498.     call lineout 'FM2.CMD', "n = directory('"curdir"')"
  499.     call lineout 'FM2.CMD', "'start fm3.exe 'curdir' %1 %2 %3 %4 %5 %6 %7 %8 %9'"
  500.     call lineout 'FM2.CMD', "n = endlocal()"
  501.     call stream 'FM2.CMD','C','close'
  502.     'del AV2.CMD 1>NUL 2>NUL'
  503.     dummy = stream('AV2.CMD','C','open')
  504.     if dummy = 'READY:' then
  505.     do
  506.       say 'Creating an AV2.CMD file.'
  507.       call lineout 'AV2.CMD', "/* AV/2 command file.  Locate in a directory"
  508.       call lineout 'AV2.CMD', " * on your PATH. */"
  509.       call lineout 'AV2.CMD', "'@echo off'"
  510.       call lineout 'AV2.CMD', "arg arg1"
  511.       call lineout 'AV2.CMD', "if arg1 \= '' then arg1 = stream(arg1,'c','query exists')"
  512.       call lineout 'AV2.CMD', "n = setlocal()"
  513.       call lineout 'AV2.CMD', "n = directory('"curdir"')"
  514.       call lineout 'AV2.CMD', "'start av2.exe 'arg1"
  515.       call lineout 'AV2.CMD', "n = endlocal()"
  516.       call stream 'AV2.CMD','C','close'
  517.     end
  518.     else say "Couldn't create AV2.CMD file."
  519.     'del VDIR.CMD 1>NUL 2>NUL'
  520.     dummy = stream('VDIR.CMD','C','open')
  521.     if dummy = 'READY:' then
  522.     do
  523.       say 'Creating a VDIR.CMD file.'
  524.       call lineout 'VDIR.CMD', "/* VDIR (FM/2) command file.  Locate in a directory"
  525.       call lineout 'VDIR.CMD', " * on your PATH. */"
  526.       call lineout 'VDIR.CMD', "'@echo off'"
  527.       call lineout 'VDIR.CMD', "arg dummy"
  528.       call lineout 'VDIR.CMD', "if dummy = '' then"
  529.       call lineout 'VDIR.CMD', "  curdir = directory()"
  530.       call lineout 'VDIR.CMD', "else"
  531.       call lineout 'VDIR.CMD', "  curdir = ''"
  532.       call lineout 'VDIR.CMD', "n = setlocal()"
  533.       call lineout 'VDIR.CMD', "n = directory('"curdir"')"
  534.       call lineout 'VDIR.CMD', "'start vdir.exe 'curdir' %1 %2 %3 %4 %5 %6 %7 %8 %9'"
  535.       call lineout 'VDIR.CMD', "n = endlocal()"
  536.       call stream 'VDIR.CMD','C','close'
  537.     end
  538.     else say "Couldn't create VDIR.CMD file."
  539.     'del VTREE.CMD 1>NUL 2>NUL'
  540.     dummy = stream('VTREE.CMD','C','open')
  541.     if dummy = 'READY:' then
  542.     do
  543.       say 'Creating a VTREE.CMD file.'
  544.       call lineout 'VTREE.CMD', "/* VTREE (FM/2) command file.  Locate in a directory"
  545.       call lineout 'VTREE.CMD', " * on your PATH. */"
  546.       call lineout 'VTREE.CMD', "'@echo off'"
  547.       call lineout 'VTREE.CMD', "n = setlocal()"
  548.       call lineout 'VTREE.CMD', "n = directory('"curdir"')"
  549.       call lineout 'VTREE.CMD', "'start vtree.exe %1 %2 %3 %4 %5 %6 %7 %8 %9'"
  550.       call lineout 'VTREE.CMD', "n = endlocal()"
  551.       call stream 'VTREE.CMD','C','close'
  552.     end
  553.     else say "Couldn't create VTREE.CMD file."
  554.     'del VCOLLECT.CMD 1>NUL 2>NUL'
  555.     dummy = stream('VCOLLECT.CMD','C','open')
  556.     if dummy = 'READY:' then
  557.     do
  558.       say 'Creating a VCOLLECT.CMD file.'
  559.       call lineout 'VCOLLECT.CMD', "/* VCOLLECT (FM/2) command file.  Locate in a directory"
  560.       call lineout 'VCOLLECT.CMD', " * on your PATH. */"
  561.       call lineout 'VCOLLECT.CMD', "'@echo off'"
  562.       call lineout 'VCOLLECT.CMD', "n = setlocal()"
  563.       call lineout 'VCOLLECT.CMD', "n = directory('"curdir"')"
  564.       call lineout 'VCOLLECT.CMD', "'start vcollect.exe %1 %2 %3 %4 %5 %6 %7 %8 %9'"
  565.       call lineout 'VCOLLECT.CMD', "n = endlocal()"
  566.       call stream 'VCOLLECT.CMD','C','close'
  567.     end
  568.     else say "Couldn't create VCOLLECT.CMD file."
  569.     'del INI.CMD 1>NUL 2>NUL'
  570.     dummy = stream('INI.CMD','C','open')
  571.     if dummy = 'READY:' then
  572.     do
  573.       say 'Creating an INI.CMD file.'
  574.       call lineout 'INI.CMD', "/* INI (FM/2) command file.  Locate in a directory"
  575.       call lineout 'INI.CMD', " * on your PATH. */"
  576.       call lineout 'INI.CMD', "'@echo off'"
  577.       call lineout 'INI.CMD', "n = setlocal()"
  578.       call lineout 'INI.CMD', "n = directory('"curdir"')"
  579.       call lineout 'INI.CMD', "'start INI.exe %1 %2 %3'"
  580.       call lineout 'INI.CMD', "n = endlocal()"
  581.       call stream 'INI.CMD','C','close'
  582.     end
  583.     else say "Couldn't create INI.CMD file."
  584.     'del EAS.CMD 1>NUL 2>NUL'
  585.     dummy = stream('EAS.CMD','C','open')
  586.     if dummy = 'READY:' then
  587.     do
  588.       say 'Creating an EAS.CMD file.'
  589.       call lineout 'EAS.CMD', "/* EAS (FM/2) command file.  Locate in a directory"
  590.       call lineout 'EAS.CMD', " * on your PATH. */"
  591.       call lineout 'EAS.CMD', "'@echo off'"
  592.       call lineout 'EAS.CMD', "n = setlocal()"
  593.       call lineout 'EAS.CMD', "n = directory('"curdir"')"
  594.       call lineout 'EAS.CMD', "'start eas.exe %1 %2 %3'"
  595.       call lineout 'EAS.CMD', "n = endlocal()"
  596.       call stream 'EAS.CMD','C','close'
  597.     end
  598.     else say "Couldn't create EAS.CMD file."
  599.     'del UNDEL.CMD 1>NUL 2>NUL'
  600.     dummy = stream('UNDEL.CMD','C','open')
  601.     if dummy = 'READY:' then
  602.     do
  603.       say 'Creating an UNDEL.CMD file.'
  604.       call lineout 'UNDEL.CMD', "/* UNDEL (FM/2) command file.  Locate in a directory"
  605.       call lineout 'UNDEL.CMD', " * on your PATH. */"
  606.       call lineout 'UNDEL.CMD', "'@echo off'"
  607.       call lineout 'UNDEL.CMD', "n = setlocal()"
  608.       call lineout 'UNDEL.CMD', "n = directory('"curdir"')"
  609.       call lineout 'UNDEL.CMD', "'start undel.exe %1'"
  610.       call lineout 'UNDEL.CMD', "n = endlocal()"
  611.       call stream 'UNDEL.CMD','C','close'
  612.     end
  613.     else say "Couldn't create UNDEL.CMD file."
  614.     'del KILLPROC.CMD 1>NUL 2>NUL'
  615.     dummy = stream('KILLPROC.CMD','C','open')
  616.     if dummy = 'READY:' then
  617.     do
  618.       say 'Creating a KILLPROC.CMD file.'
  619.       call lineout 'KILLPROC.CMD', "/* KILLPROC (FM/2) command file.  Locate in a directory"
  620.       call lineout 'KILLPROC.CMD', " * on your PATH. */"
  621.       call lineout 'KILLPROC.CMD', "'@echo off'"
  622.       call lineout 'KILLPROC.CMD', "n = setlocal()"
  623.       call lineout 'KILLPROC.CMD', "n = directory('"curdir"')"
  624.       call lineout 'KILLPROC.CMD', "'start killproc.exe'"
  625.       call lineout 'KILLPROC.CMD', "n = endlocal()"
  626.       call stream 'KILLPROC.CMD','C','close'
  627.     end
  628.     else say "Couldn't create KILLPROC.CMD file."
  629.     'del VIEWINFS.CMD 1>NUL 2>NUL'
  630.     dummy = stream('VIEWINFS.CMD','C','open')
  631.     if dummy = 'READY:' then
  632.     do
  633.       say 'Creating a VIEWINFS.CMD file.'
  634.       call lineout 'VIEWINFS.CMD', "/* VIEWINFS (FM/2) command file.  Locate in a directory"
  635.       call lineout 'VIEWINFS.CMD', " * on your PATH. */"
  636.       call lineout 'VIEWINFS.CMD', "'@echo off'"
  637.       call lineout 'VIEWINFS.CMD', "n = setlocal()"
  638.       call lineout 'VIEWINFS.CMD', "n = directory('"curdir"')"
  639.       call lineout 'VIEWINFS.CMD', "'start viewinfs.exe'"
  640.       call lineout 'VIEWINFS.CMD', "n = endlocal()"
  641.       call stream 'VIEWINFS.CMD','C','close'
  642.     end
  643.     else say "Couldn't create VIEWINFS.CMD file."
  644.     'del VIEWHELP.CMD 1>NUL 2>NUL'
  645.     dummy = stream('VIEWHELP.CMD','C','open')
  646.     if dummy = 'READY:' then
  647.     do
  648.       say 'Creating a VIEWHELP.CMD file.'
  649.       call lineout 'VIEWHELP.CMD', "/* VIEWHELP (FM/2) command file.  Locate in a directory"
  650.       call lineout 'VIEWHELP.CMD', " * on your PATH. */"
  651.       call lineout 'VIEWHELP.CMD', "'@echo off'"
  652.       call lineout 'VIEWHELP.CMD', "n = setlocal()"
  653.       call lineout 'VIEWHELP.CMD', "n = directory('"curdir"')"
  654.       call lineout 'VIEWHELP.CMD', "'start viewinfs.exe DUMMY'"
  655.       call lineout 'VIEWHELP.CMD', "n = endlocal()"
  656.       call stream 'VIEWHELP.CMD','C','close'
  657.     end
  658.     else say "Couldn't create VIEWHELP.CMD file."
  659.     'del GLOBAL.CMD 1>NUL 2>NUL'
  660.     dummy = stream('GLOBAL.CMD','C','open')
  661.     if dummy = 'READY:' then
  662.     do
  663.       say 'Creating a GLOBAL.CMD file.'
  664.       call lineout 'GLOBAL.CMD', "/* GLOBAL (FM/2) command file.  Locate in a directory"
  665.       call lineout 'GLOBAL.CMD', " * on your PATH. */"
  666.       call lineout 'GLOBAL.CMD', "'@echo off'"
  667.       call lineout 'GLOBAL.CMD', "n = setlocal()"
  668.       call lineout 'GLOBAL.CMD', "n = directory('"curdir"')"
  669.       call lineout 'GLOBAL.CMD', "'start global.exe'"
  670.       call lineout 'GLOBAL.CMD', "n = endlocal()"
  671.       call stream 'GLOBAL.CMD','C','close'
  672.     end
  673.     else say "Couldn't create GLOBAL.CMD file."
  674.     say ""
  675.     parse upper var curdir curdir
  676.     say "Please add the directory"
  677.     say "  "curdir"\UTILS"
  678.     say "to your PATH in CONFIG.SYS."
  679.     say "┌──────────────────────────────────────────────────────────────────┐"
  680.     say "│Remember, you'll need to reboot before such a change takes effect.│"
  681.     say "│FM/2 will run fine from its WPS objects without this change; the  │"
  682.     say "│proposed change allows it to be run from any command line, and for│"
  683.     say "│other programs that might want to use FM/2 as its file manager to │"
  684.     say "│find and run it easily.                                           │"
  685.     say "└──────────────────────────────────────────────────────────────────┘"
  686.     if existed \= "TRUE" then
  687.     do
  688.       say ""
  689.       /* remove next 6 lines for unattended use */
  690.       call charout ,'  Press [Enter] for more...'
  691.       dummy = ''
  692.       do until dummy = '0d'x
  693.         dummy = SysGetKey('NOECHO')
  694.       end
  695.       call charout ,'0d1b'x'[K'
  696.       rc = stream('fatopt.exe','c','query exists')
  697.       say   "┌────────────────────────────────────────────────────────────────┐"
  698.       if rc = '' then
  699.       do
  700.         say "│I suggest that you place the utilities from the FM/2 Utilities  │"
  701.         say "│archive in this directory, also, in which case you should       │"
  702.         say "│_definitely_ make the change to PATH so that FM/2 can find them.│"
  703.       end
  704.       say   "│You may want to tweak the command lines in the .CMD files I just│"
  705.       say   "│built and/or those in the WPS objects in the FM/2 folder for    │"
  706.       say   "│desired specific behaviors.  The READ.ME file will tell you how.│"
  707.       say   "└────────────────────────────────────────────────────────────────┘"
  708.     end
  709.     if existed = 'TRUE' then
  710.     do
  711.       say ''
  712.       say "If you have previously altered your CONFIG.SYS's PATH statement"
  713.       say 'as instructed above, please ignore this rambling.'
  714.     end
  715.     say ""
  716.     /* remove next 6 lines for unattended use */
  717.     call charout ,'  Press [Enter] to continue...'
  718.     dummy = ''
  719.     do until dummy = '0d'x
  720.       dummy = SysGetKey('NOECHO')
  721.     end
  722.     call charout ,'0d1b'x'[K'
  723.   end
  724.   else say "Couldn't create FM2.CMD file.  Panic."
  725.   dummy = directory(curdir)
  726. end
  727. else say "Couldn't switch to "curdir"\utils"
  728.  
  729. /* Migrate old settings from FM2.INI if it exists and an FM3.INI doesn't */
  730.  
  731. rc = stream('fm3.ini','c','query exists')
  732. if rc \= '' then
  733.   say 'An FM3.INI exists -- not attempting to migrate 1.x information.'
  734. else
  735. do
  736.   /* if we can find FM2.INI, run MIGINI.CMD */
  737.   fm2ini = value('fm2ini',,'OS2ENVIRONMENT')
  738.   if fm2ini \= '' then fm2ini = stream(fm2ini,'c','query exists')
  739.   if fm2ini = '' then
  740.   do
  741.     fm2ini = value('fm2ini',,'OS2ENVIRONMENT')
  742.     if fm2ini \= '' then
  743.     do
  744.       fm2ini = insert('\FM2.INI',fm2ini,length(fm2ini))
  745.       fm2ini = stream(fm2ini,'c','query exists')
  746.     end
  747.   end
  748.   fm2ini = SysSearchPath('PATH', 'FM2.INI')
  749.   if fm2ini = '' then fm2ini = SysSearchPath('DPATH', 'FM2.INI')
  750.   if fm2ini = '' then fm2ini = SysSearchPath('XPATH', 'FM2.INI')
  751.   if fm2ini \= '' then
  752.   do
  753.     'call migini.cmd dummy'
  754.     say ''
  755.     say '  (You can remove the old FM/2 1.x files when installation completes.)'
  756.     call SysSleep 2
  757.     say ''
  758.   end
  759. end
  760.  
  761. /* type the install.dat file to show any critical info/notices */
  762.  
  763. /* NOTE:  remove following 8 lines for unattended use... */
  764. rc = stream('install.dat','c','query exists')
  765. if rc \= '' then
  766. do
  767.   'type install.dat'
  768.   'DEL INSTALL.DAT 1>NUL 2>NUL'
  769.   /* remove next 6 lines for unattended use */
  770.   call charout ,'  Press [Enter] to continue...'
  771.   dummy = ''
  772.   do until dummy = '0d'x
  773.     dummy = SysGetKey('NOECHO')
  774.   end
  775.   call charout ,'0d1b'x'[K'
  776. end
  777.  
  778. /* Final words */
  779.  
  780. say '┌──────────────────────────────────────────────────────────────────────────┐'
  781. say '│To move FM/2 to another directory, move the files, delete the FM/2 folder,│'
  782. say '│then rerun INSTALL.  There is no need to "uninstall" to move FM/2.        │'
  783. say '│                                                                          │'
  784. say '│To remove FM/2 completely, run UNINSTAL and follow its directions.        │'
  785. say '└──────────────────────────────────────────────────────────────────────────┘'
  786. say "I'm done now."
  787. say ''
  788.  
  789.